<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="next-config" data-name="main" type="application/json">{&quot;hostname&quot;:&quot;example.com&quot;,&quot;root&quot;:&quot;&#x2F;&quot;,&quot;images&quot;:&quot;&#x2F;images&quot;,&quot;scheme&quot;:&quot;Muse&quot;,&quot;version&quot;:&quot;8.3.0&quot;,&quot;exturl&quot;:false,&quot;sidebar&quot;:{&quot;position&quot;:&quot;left&quot;,&quot;display&quot;:&quot;post&quot;,&quot;padding&quot;:18,&quot;offset&quot;:12},&quot;copycode&quot;:false,&quot;bookmark&quot;:{&quot;enable&quot;:false,&quot;color&quot;:&quot;#222&quot;,&quot;save&quot;:&quot;auto&quot;},&quot;fancybox&quot;:false,&quot;mediumzoom&quot;:false,&quot;lazyload&quot;:false,&quot;pangu&quot;:false,&quot;comments&quot;:{&quot;style&quot;:&quot;tabs&quot;,&quot;active&quot;:null,&quot;storage&quot;:true,&quot;lazyload&quot;:false,&quot;nav&quot;:null},&quot;motion&quot;:{&quot;enable&quot;:true,&quot;async&quot;:false,&quot;transition&quot;:{&quot;post_block&quot;:&quot;fadeIn&quot;,&quot;post_header&quot;:&quot;fadeInDown&quot;,&quot;post_body&quot;:&quot;fadeInDown&quot;,&quot;coll_header&quot;:&quot;fadeInLeft&quot;,&quot;sidebar&quot;:&quot;fadeInUp&quot;}},&quot;prism&quot;:false,&quot;i18n&quot;:{&quot;placeholder&quot;:&quot;搜索...&quot;,&quot;empty&quot;:&quot;没有找到任何搜索结果：${query}&quot;,&quot;hits_time&quot;:&quot;找到 ${hits} 个搜索结果（用时 ${time} 毫秒）&quot;,&quot;hits&quot;:&quot;找到 ${hits} 个搜索结果&quot;}}</script>
<meta name="description" content="在HTTP的协议中，客户端发送请求给服务端，服务端响应回复给客服端的同时，还会带上HTTP协议的状态码，具体状态码介绍如下。 1.状态码之200在HTTP的协议中，状态码200是请求成功，也就是说客户端发送请求给服务端，服务端响应回复给客户端这个过程是成功的。 2.状态码之201状态码201指的是用于创建服务器对象的请求，它的短语是Created。 3.状态码之302状态码302是临时重定向 4.">
<meta property="og:type" content="article">
<meta property="og:title" content="HTTP的状态码">
<meta property="og:url" content="http://example.com/2021/04/12/Python%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E6%88%98/9.2%20HTTP%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81/index.html">
<meta property="og:site_name" content="暮成雪">
<meta property="og:description" content="在HTTP的协议中，客户端发送请求给服务端，服务端响应回复给客服端的同时，还会带上HTTP协议的状态码，具体状态码介绍如下。 1.状态码之200在HTTP的协议中，状态码200是请求成功，也就是说客户端发送请求给服务端，服务端响应回复给客户端这个过程是成功的。 2.状态码之201状态码201指的是用于创建服务器对象的请求，它的短语是Created。 3.状态码之302状态码302是临时重定向 4.">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-04-12T03:56:39.000Z">
<meta property="article:modified_time" content="2021-04-13T05:00:20.081Z">
<meta property="article:author" content="寒蝉">
<meta property="article:tag" content="Python自动化测试实战">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/2021/04/12/Python%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E6%88%98/9.2%20HTTP%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81/">



<script class="next-config" data-name="page" type="application/json">{&quot;sidebar&quot;:&quot;&quot;,&quot;isHome&quot;:false,&quot;isPost&quot;:true,&quot;lang&quot;:&quot;zh-CN&quot;,&quot;comments&quot;:true,&quot;permalink&quot;:&quot;http:&#x2F;&#x2F;example.com&#x2F;2021&#x2F;04&#x2F;12&#x2F;Python%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E6%88%98&#x2F;9.2%20HTTP%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81&#x2F;&quot;,&quot;path&quot;:&quot;2021&#x2F;04&#x2F;12&#x2F;Python自动化测试实战&#x2F;9.2 HTTP的状态码&#x2F;&quot;,&quot;title&quot;:&quot;HTTP的状态码&quot;}</script>

<script class="next-config" data-name="calendar" type="application/json">&quot;&quot;</script>
<title>HTTP的状态码 | 暮成雪</title><script src="/js/config.js"></script>
  




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">暮成雪</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>







</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B200"><span class="nav-number">1.</span> <span class="nav-text">1.状态码之200</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B201"><span class="nav-number">2.</span> <span class="nav-text">2.状态码之201</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B302"><span class="nav-number">3.</span> <span class="nav-text">3.状态码之302</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B400"><span class="nav-number">4.</span> <span class="nav-text">4.状态码之400</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B404"><span class="nav-number">5.</span> <span class="nav-text">5.状态码之404</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#6-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B401"><span class="nav-number">6.</span> <span class="nav-text">6.状态码之401</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#7-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B403"><span class="nav-number">7.</span> <span class="nav-text">7.状态码之403</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#8-%E7%8A%B6%E6%80%81%E7%A0%81%E4%B9%8B500"><span class="nav-number">8.</span> <span class="nav-text">8.状态码之500</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">寒蝉</p>
  <div class="site-description" itemprop="description">今天太阳也东升，而后西沉，早晨盛开的花儿也将凋谢；今天的太阳也西沉，而后东升，阳光照射之处遍地花开，但却已非昨日之花。</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives">
          <span class="site-state-item-count">9</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">1</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/04/12/Python%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E6%88%98/9.2%20HTTP%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="寒蝉">
      <meta itemprop="description" content="今天太阳也东升，而后西沉，早晨盛开的花儿也将凋谢；今天的太阳也西沉，而后东升，阳光照射之处遍地花开，但却已非昨日之花。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="暮成雪">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          HTTP的状态码
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-04-12 11:56:39" itemprop="dateCreated datePublished" datetime="2021-04-12T11:56:39+08:00">2021-04-12</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">更新于</span>
        <time title="修改时间：2021-04-13 13:00:20" itemprop="dateModified" datetime="2021-04-13T13:00:20+08:00">2021-04-13</time>
      </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p>在HTTP的协议中，客户端发送请求给服务端，服务端响应回复给客服端的同时，还会带上HTTP协议的状态码，具体状态码介绍如下。</p>
<h4 id="1-状态码之200"><a href="#1-状态码之200" class="headerlink" title="1.状态码之200"></a>1.状态码之200</h4><p>在HTTP的协议中，状态码200是请求成功，也就是说客户端发送请求给服务端，服务端响应回复给客户端这个过程是成功的。</p>
<h4 id="2-状态码之201"><a href="#2-状态码之201" class="headerlink" title="2.状态码之201"></a>2.状态码之201</h4><p>状态码201指的是用于创建服务器对象的请求，它的短语是Created。</p>
<h4 id="3-状态码之302"><a href="#3-状态码之302" class="headerlink" title="3.状态码之302"></a>3.状态码之302</h4><p>状态码302是临时重定向</p>
<h4 id="4-状态码之400"><a href="#4-状态码之400" class="headerlink" title="4.状态码之400"></a>4.状态码之400</h4><p>客户端向服务端发送请求服务端返回400 BAD REQUEST，指的是客户端请求的语法错误，服务端无法理解。</p>
<h4 id="5-状态码之404"><a href="#5-状态码之404" class="headerlink" title="5.状态码之404"></a>5.状态码之404</h4><p>当客户端向服务端发送请求，但请求的URL在服务器里不存在，此时会返回状态码404 NOT FOUND。</p>
<h4 id="6-状态码之401"><a href="#6-状态码之401" class="headerlink" title="6.状态码之401"></a>6.状态码之401</h4><p>状态码401指的是被请求的页面需要账号和密码。</p>
<h4 id="7-状态码之403"><a href="#7-状态码之403" class="headerlink" title="7.状态码之403"></a>7.状态码之403</h4><p>状态码403指的是服务器理解客服端的请求，但是拒绝执行。通俗地说就是客户端去请求某一资源，由于权限等原因，服务器拒绝客户端的请求。</p>
<h4 id="8-状态码之500"><a href="#8-状态码之500" class="headerlink" title="8.状态码之500"></a>8.状态码之500</h4><p>状态码500表示客户端发送请求到服务端后，服务端内部发生不可预知的错误导致客户端的请求未完成。</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Python%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E6%88%98/" rel="tag"># Python自动化测试实战</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2021/04/12/hello-world/" rel="prev" title="Hello World">
                  <i class="fa fa-chevron-left"></i> Hello World
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2021/04/12/Python%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E6%88%98/9.3%20Cookie%E7%9A%84%E8%AF%B7%E6%B1%82%E6%B5%81%E7%A8%8B/" rel="next" title="Cookie的请求流程">
                  Cookie的请求流程 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>





<script src="/js/comments.js"></script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">寒蝉</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  






  





</body>
</html>
